import {createStore} from 'redux'


let states={
    msg:'redux中的信息数据',
    num:111
}
function reducer(state=states,action){
   let instate=JSON.parse(JSON.stringify(state))

   switch (action.type) {
       case 'm':
           instate={
               ...instate,
               msg:instate.msg+'*'
           };
           break;
       case 'n':
           instate={
               ...instate,
               num:instate.num+3
           }
       default:
           break;
   }
   return instate
}

let store=createStore(reducer)

export default store